package com.github.jinatonic.confetti.sample.slice;

import com.github.jinatonic.confetti.CommonConfetti;
import com.github.jinatonic.confetti.ConfettiManager;

public class ExplosionAbilitySlice extends AbstractAbilitySlice{
    @Override
    protected ConfettiManager generateOnce() {
        return getCommonConfetti().oneShot();
    }

    @Override
    protected ConfettiManager generateStream() {
        return getCommonConfetti().stream(3000);
    }

    @Override
    protected ConfettiManager generateInfinite() {
        return getCommonConfetti().infinite();
    }

    private CommonConfetti getCommonConfetti() {
        final int centerX = container.getWidth() / 2;
        final int centerY = container.getHeight() / 5 * 2;
        return CommonConfetti.explosion(container, centerX, centerY, getColors());
    }
}
